package com.gopay.common.cps.dao.wallet.base;

import java.io.Serializable;
import java.util.List;

import com.gopay.common.base.dao.BaseDAO;
import com.gopay.common.domain.dps.WaCertificate;

public interface WaCertificateDao extends BaseDAO<WaCertificate, Serializable> {

	public WaCertificate saveWaCertificate(WaCertificate  waCertificate);
	
	public void updateAwMsgSend(WaCertificate  waCertificate);
	
	public WaCertificate queryByDeviceIdAndUserId(String deviceId , String userId);
	
	public List<WaCertificate> queryByCustId(String custId );
	
	public int deleteByCustId(String custId);
	
	public WaCertificate queryBySn(String sn);
	
	/**
	 * 根据userId和证书状态查询证书列表
	 * @param userId
	 * @param stat
	 * @return
	 * liuxuyang
	 */
	public List<WaCertificate> getCustCaCertListByUserId(String userId, String stat);
	
	/**
	 * 
	 * @Description: 获取同一个用户同一设备下的证书列表 
	 * @param userId
	 * @param deviceId
	 * @param stat
	 * @return 
	 * @author liuxuyang
	 */
	public List<WaCertificate> getCustCertList(String userId,String deviceId, String stat);
	
    /**
     * 获取过期的移动数字证书
     * @return
     */
    public List<WaCertificate> getLimitWaCertificate();
    
    /**
     * @Description: 回收将安装记录中已分配状态置为已申请状态
     * @param buyDtlId 
     * @author liuxuyang
     */
    public void updateCertApplyStatus(long buyDtlId) ;
    
    /**
     * @Description: 批量插入申请数据
     * @param buyDtlId 
     * @author liuxuyang
     */
    public void batchInsertApplyCert(long buyDtlId);
    /**
     * 根据userId和设备ID获取最近的一条数据
     * @param userId
     * @param deviceId
     * @param stat
     * @return
     */
    public WaCertificate getCertByUserIdAndDeviceId(String userId,String deviceId);
}
